package com.yn.common.response.zy;


import cn.hutool.core.lang.Dict;
import com.yn.common.model.system.SystemConfig;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="字典返回对象", description="字典对象")
public class DictResponse {
    @ApiModelProperty(value = "字典key")
    private String key;

    @ApiModelProperty(value = "字典value")
    private String value;

    public static DictResponse transform(SystemConfig config) {
        DictResponse dictResponse = new DictResponse();
        dictResponse.setKey(config.getTitle());
        dictResponse.setValue(config.getValue());
        return dictResponse;
    }
}
